<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
  * {
    margin: 0;
    padding: 0;
  }
  .felx{
    display: flex;
  }
  .box {
    background-color: green;
    width: 100px;
    height: 100px;
  }
  .box:nth-child(odd){
    background-color: red;
  }
  </style>
</head>
<body>
  <div class="flex">
    <div class="box">1</div>
    <div class="box">2</div>
    <div class="box">3</div>
  </div>
</body>
</html>